<template>
    <div>
        <el-menu 
        :default-active="defaultActive" 
        background-color="#545C64" 
        text-color="#fff" 
        active-text-color="#ffd04b"
        unique-opened
        router
        >
            <el-menu-item index="/home">
                <i class="el-icon-menu"></i>
                <span slot="title">首页</span>
            </el-menu-item>

            <el-submenu v-for="item in $store.getters.getUser.menus"  :index="item.id.toString()" :key="item.id">
                <template slot="title">
                    <i :class="item.icon"></i>
                    <span>{{ item.title }}</span>
                </template>
                <el-menu-item v-for="menu in item.children" :key="menu.id" :index="menu.url">{{menu.title}}</el-menu-item>
              

            </el-submenu>
           
        </el-menu>
    </div>
</template>
<script>
export default {
    data() {
        return {
            defaultActive:"/home"
        }
    },
    methods: {},
    mounted() {
        this.defaultActive = this.$route.path
        // console.log(this.$store.getters);
     },
    watch: {},
    computed: {},
    filters: {},
    components: {}
}
</script>
<style scoped>
  .el-menu{
    height: 887px;
 }
</style>